//################################################################################################################################//
//##                                                                                                                            ##//
//## This User Control is implement for create the doctor menu bar                                                              ##//
//##                                                                                                                            ##//
//## Author   : Sharvan                                                                                                         ##//
//## Dated    : 16-03-2006                                                                                                      ##//
//##                                                                                                                            ##//
//## Further reconstructed, so that it could used for the dentist also.                                                         ##//
//##                                                                                                                            ##//
//## Author   : Kajal                                                                                                           ##//
//## Dated    : 08-05-2007                                                                                                      ##//
//##                                                                                                                            ##//
//################################################################################################################################//
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class includes_DoctorMenu : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        localFunction lFunction= new localFunction();
       
        // check doctor logged in
        if (!lFunction.checkDoctorLogin(false))
        {            
            this.Visible = false;
        }
        else
        {
            //check for that the logged-in doctor is a dentist or not
            if (!lFunction.checkDoctorLogin(false))
            {
                lblMenuHead.Text = "Dentist Center";
            }
            else
            {
                //the logged in doctor is not a dentist
                if(Convert.ToString(Session["DoctorType"]).ToUpper() == "DENTIST")
                lblMenuHead.Text = "Dentist Center";
                else
                lblMenuHead.Text = "Doctor Center";
            }
        }
    }
    private bool _doctorCenter=false;

    public bool doctorCenter
    {
        get { return _doctorCenter; }
        set { _doctorCenter= value; }
    }
    private bool _doctorWithProfile = false;

    public bool doctorWithProfile
    {
        get { return _doctorWithProfile; }
        set { _doctorWithProfile = value; }
    }
	
    // log off
    protected void lnkLogOff_Click(object sender, EventArgs e)
    {
        localFunction lFunction = new localFunction();
        if (Session["DoctorType"].ToString() == "Dentist")
        { lFunction.logOffDentist(); }
        else { lFunction.logOffDoctor(); }
    }
    
    protected void lnkEdit_Click(object sender, EventArgs e)
    {
        if (Session["DoctorType"].ToString() == "Dentist")
        {
            Response.Redirect(Session["strHttps"] + "Dentist/DentistRegistration.aspx?id=" + Session["userID"].ToString());
        }
        else
        {
            Session["pageFromOrAction"] = "Edit";
            Response.Redirect(Session["strHttps"] + "doctor/doctorRegistration.aspx");
        }
    }

    // sign out
    protected void lnksignOut_Click(object sender, EventArgs e)
    {
        localFunction lFunction = new localFunction();
        if (Session["DoctorType"].ToString() == "Dentist")
        {
            lFunction.logOffDentist();
        }
        else
        {
            lFunction.logOffDoctor();
        }
    }
}
